const PaymentRequest = (location, callback) => {
  require.ensure([], require => {
    callback(null, require('containers/payment-request').default);
  }, 'payment-request');
};

const NewPaymentRequest = (location, callback) => {
  require.ensure([], require => {
    callback(null, require('containers/payment-request/new-payment').default);
  }, 'new-payment-request');
};

const PaymentDetails = (location, callback) => {
  require.ensure([], require => {
    callback(null, require('containers/payment-request/payment-details').default);
  }, 'payment-details');
};


const paymentRequest = {
  key: 'payment',
  icon: 'file',
  subMenu: [
    //付款申请单
    {
      key: 'payment-request',
      url: '/main/payment/payment-request',
      components: PaymentRequest,
      parent: 'payment',
      children: {
        //付款申请单新建
        newPaymentRequest: {
          key: 'new-payment-request',
          url: '/main/payment/payment-request/new-payment/:formId/:userOID/:applicationOID/:applicantJobId',
          components: NewPaymentRequest,
          parent: 'payment-request'
        },
        //付款申请单详情
        paymentDetails: {
          key: 'payment-details',
          url: '/main/payment/payment-request/payment-details/:paymentRequestOID',
          components: PaymentDetails,
          parent: 'payment-details'
        },
        //付款申请单详情
        myPaymentDetails: {
          key: 'payment-details',
          url: '/main/payment/payment-request/payment-details/:paymentRequestOID/:entry',
          components: PaymentDetails,
          parent: 'payment-details'
        }
      }
    }]
};
export default paymentRequest;
